package org.shoukaiseki.common.domain;

import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.shoukaiseki.kakaroto.Interface.DictTypeEnumData;
import org.shoukaiseki.common.utils.StringUtils;

import java.util.Map;

public class SksEntity {

    //应用程序限制 JPA 过滤方式
//    private Map<String,Object> sksAppRestrictionMap;

//    用于判断当前应用程序名称
    private String mybatisRestrictionName;



    //用于存放关联表的数据
    private Map<String,? extends SksEntity> relationshipMap;

    //    CustomQO 转的时候需要该属性的值
    @JsonIgnore
    @JsonProperty
    @JSONField(serialize = false)
    public Map<String, ? extends SksEntity> getRelationshipMap() {
        return relationshipMap;
    }

    public void setRelationshipMap(Map<String, ? extends SksEntity> relationshipMap) {
        this.relationshipMap = relationshipMap;
    }

    //CustomQO 转的时候需要该属性的值
    @JsonIgnore
    @JsonProperty
    @JSONField(serialize = false)
    public String getMybatisRestrictionName() {
        if(mybatisRestrictionName ==null){
            return StringUtils.EMPTY;
        }
        return mybatisRestrictionName;
    }


    //设置mybatis限制名称
    public  void mybatisRestrictionName(DictTypeEnumData mybatisRestrictionName) {
        this.mybatisRestrictionName = mybatisRestrictionName.getValueString();
    }

    public void setMybatisRestrictionName(String mybatisRestrictionName) {
        this.mybatisRestrictionName = mybatisRestrictionName;
    }

//    @JsonIgnore
//    @JsonProperty
//    @JSONField(serialize = false)
//    public Map<String, Object> getSksAppRestrictionMap() {
//        if (sksAppRestrictionMap == null)
//        {
//            sksAppRestrictionMap = new HashMap<>();
//        }
//        return sksAppRestrictionMap;
//    }
//
//    public void setSksAppRestrictionMap(Map<String, Object> sksAppRestrictionMap) {
//        this.sksAppRestrictionMap = sksAppRestrictionMap;
//    }
}
